import { App } from 'vue'
//  injectKey?: InjectionKey<any>

import {
  Button,
  Alert,
  Menu,
  Form,
  Dropdown,
  Avatar,
  message,
  Layout,
  Drawer,
  Row,
  Col,
  Breadcrumb,
  Tooltip,
  Tabs,
  Divider,
} from 'ant-design-vue'

const components = [
  Button,
  Alert,
  Menu,
  Menu.Item,
  Menu.SubMenu,
  Menu.Divider,
  Menu.ItemGroup,
  Form,
  Form.Item,
  Dropdown,
  Avatar,
  Layout,
  Layout.Content,
  Layout.Footer,
  Layout.Sider,
  Layout.Header,
  Drawer,
  Row,
  Col,
  Breadcrumb,
  Breadcrumb.Item,
  Tooltip,
  Tabs,
  Tabs.TabPane,
  Divider,
]

const install = function install(app: App) {
  app.config.globalProperties.$message = message

  components.forEach((component) => {
    app.component(component.name, component)
  })
}

export default {
  install,
}
